package com.kgc.server.dao;

import com.kgc.server.pojo.EasybuyOrder;
import com.kgc.server.pojo.EasybuyOrderDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EasybuyOrderDao {

    /**
     * 添加订单
     * @param easybuyOrder
     * @return
     */
    public int addOrder(EasybuyOrder easybuyOrder);

    /**
     * 查询用户的订单
     * @param userId
     * @return
     */
    public List<EasybuyOrder> selectUserOrder(String userId);

    /**
     * 删除订单数据
     */
    public int deleteUserOrder(String id);

    /**
     * 根据订单号查询订单
     */
    public EasybuyOrder getOrderBySerialNumber(String serialNumber);

    /**
     * 根据用户id查询用户的订单
     */
    public List<EasybuyOrder> getOrdersByUserId(@Param("userId") String userId,@Param("serialNumber") String serialNumber);

    public List<EasybuyOrderDetail> getOAndP(String oId);

}
